package cate.common.table.item.kitchenware.row;

import cate.common.table.EExcelNoteField;
import cate.common.table.EExcelRowClass;
import cate.common.table.ERow;
import cp.solution.util.str.Str;
import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.List;

@EExcelRowClass(IDTitle = "索引ID")
public class KitchenwareLevelUpRow extends ERow {
    @EExcelNoteField(fieldName = "厨具ID")
    public int tid;
    @EExcelNoteField(fieldName = "成功率")
    public double successRate;
    @EExcelNoteField(fieldName = "失败掉级")
    public int failLostLevel;
    @EExcelNoteField(fieldName = "属性组ID")
    private String attrGroupStr;
    @EExcelNoteField(fieldName = "属性重铸消耗")
    public String attrRecastCostStr;
    @EExcelNoteField(fieldName = "技能重铸消耗")
    public String skillRecastCostStr;
    @EExcelNoteField(fieldName = "强化等级")
    public int level;
    @EExcelNoteField(fieldName = "强化消耗")
    public String levelUpCostStr;
    @EExcelNoteField(fieldName = "分解获得道具")
    public String decomposeRewardStr;
    @EExcelNoteField(fieldName = "防掉级消耗")
    public String defendLostLevelCostStr;

    public List<Integer> attrGroup;

    @Override
    public void decode() {
        attrGroup = new ArrayList<>();
        if (StringUtils.isNotBlank(attrGroupStr)) {
            attrGroup = Str.strArr2intList(attrGroupStr.split(","));
        }
    }
}
